<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.js"></script>
</head>
<body>
    <button id="btn">这代码不是秒杀吗</button>
    <script>
        let btn =  document.getElementById("btn")
        btn.onclick = _.throttle(()=>{
            console.log("秒杀");
        },2000,{trailing:false})
    </script>
</body>
</html>